<template>
  <div>
    <h1>{{msg}} </h1>
    <button @click="rew">两极反转</button>
  </div>
</template>

<script>
export default {
  name: 'Vue2App',

  data() {
    return {
      msg:'HELLO,WORD'
    };
  },

  

  methods: {
    rew(){
    let arr=this.msg.split('')
    console.log(arr);
    arr.reverse()
    this. msg= arr.join('')
    //点击之后执行，msg就等于拼接之后的字符
    
    }
    
  },
};
</script>

<style lang="scss" scoped>

</style>
